<template>
    <div class="app-header">公共app状态栏头部</div>
    <div class="router-view">
        <router-view v-slot="{ Component }">
            <transition :name="viewTransition">
                <component class="router-view-root" :is="Component" />
            </transition>
        </router-view>
    </div>
</template>
<script>
export default {
    data () {
        return {

        }
    },
    computed: {
        direction () {
            return this.$store.state.direction;
        },
        viewTransition () {
            let direction = this.direction;
            return "app-pop-" + (direction === "forward" ? 'in' : 'out');
        },
    },
    mounted () {
        // this.$model.customer.getList()
    }
};
</script>
<style lang="less">
*,
:after,
:before {
    box-sizing: border-box;
}
body,
html {
    margin: 0;
    color: #fff;
    overflow-x: hidden;
    font-size: 28/2px;
    .van-toast,.van-dialog,.van-button--default{

        background-color: @bgcolor;
    }
    .van-button--default,.van-dialog__message--has-title{
        color:#fff
    }
    .van-dialog__confirm, .van-dialog__confirm:active{
        color:@yellow !important;
    }
}
#app {
    max-width: 640px;
    display: block;
    margin: 0 auto;
    position: relative;
    height: 100vh;
}
.view {
    position: relative;
    height: 100vh;
    font-family: Avenir, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
ol,
ul {
    list-style: none;
}
.app-header {
    height: @top;
    overflow: hidden;
    line-height: 20px;
    background: #fff;
    font-size: 10px;
    background: red;
    padding: 0 10px;
    color: #fff;
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    z-index: 100;
}
.router-view {
    position: absolute;
    left: 0%;
    right: 0;
    top: @top;
    background-color: #000;
    min-height: 100vh;
    overflow-x: hidden;
}
.app-pop-out-enter-active,
.app-pop-out-leave-active,
.app-pop-in-enter-active,
.app-pop-in-leave-active {
    will-change: transform;
    transition: all 0.5s;
    min-height: auto;
    height: auto;
    bottom: 0;
    left: 0;
    width: 100vw;
    top: 0;
    position: absolute;
    backface-visibility: hidden;
    perspective: 1000;
}
&.home-route-view {
    top: 120/2px !important;
}
&.person-route-view {
    top: 56px !important;
}
.app-pop-in-leave-to {
    opacity: 0;
    transform: translate3d(-100%, 0, 0);
}
.app-pop-in-enter-to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}
.app-pop-in-enter-active {
    opacity: 0;
    transform: translate3d(100%, 0, 0);
}
.app-pop-in-enter-to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.app-pop-out-leave-active {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}
.app-pop-out-enter-active {
    opacity: 0;
    transform: translate3d(-100%, 0, 0);
}
.app-pop-out-leave-to {
    opacity: 0;
    transform: translate3d(100%, 0, 0);
}
.app-pop-out-enter-to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.skeleton_ani {
    background: linear-gradient(
        90deg,
        hsla(0, 0%, 74.5%, 0.2) 25%,
        hsla(0, 0%, 50.6%, 0.24) 37%,
        hsla(0, 0%, 74.5%, 0.2) 63%
    );
    background-size: 400% 100%;
    animation: ant-skeleton-loading 1.4s ease infinite;
}

@-webkit-keyframes ant-skeleton-loading {
    0% {
        background-position: 100% 50%;
    }

    to {
        background-position: 0 50%;
    }
}

@keyframes ant-skeleton-loading {
    0% {
        background-position: 100% 50%;
    }

    to {
        background-position: 0 50%;
    }
}
</style>
